<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Range (computer programming)</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Range_(computer_programming)"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.pygments.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Range_computer_programming rootpage-Range_computer_programming skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Range (computer programming)</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><style data-mw-deduplicate="TemplateStyles:r1251242444">
/* start https://en.wikipedia.org/ */
.mw-parser-output .ambox{border:1px solid #a2a9b1;border-left:10px solid #36c;background-color:#fbfbfb;box-sizing:border-box}.mw-parser-output .ambox+link+.ambox,.mw-parser-output .ambox+link+style+.ambox,.mw-parser-output .ambox+link+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+style+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+link+.ambox{margin-top:-1px}html body.mediawiki .mw-parser-output .ambox.mbox-small-left{margin:4px 1em 4px 0;overflow:hidden;width:238px;border-collapse:collapse;font-size:88%;line-height:1.25em}.mw-parser-output .ambox-speedy{border-left:10px solid #b32424;background-color:#fee7e6}.mw-parser-output .ambox-delete{border-left:10px solid #b32424}.mw-parser-output .ambox-content{border-left:10px solid #f28500}.mw-parser-output .ambox-style{border-left:10px solid #fc3}.mw-parser-output .ambox-move{border-left:10px solid #9932cc}.mw-parser-output .ambox-protection{border-left:10px solid #a2a9b1}.mw-parser-output .ambox .mbox-text{border:none;padding:0.25em 0.5em;width:100%}.mw-parser-output .ambox .mbox-image{border:none;padding:2px 0 2px 0.5em;text-align:center}.mw-parser-output .ambox .mbox-imageright{border:none;padding:2px 0.5em 2px 0;text-align:center}.mw-parser-output .ambox .mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ambox .mbox-image-div{width:52px}@media(min-width:720px){.mw-parser-output .ambox{margin:0 10%}}@media print{body.ns-0 .mw-parser-output .ambox{display:none!important}}
/* end https://en.wikipedia.org/ */
</style>
<p>In <a href="Computer_science" title="Computer science">computer science</a>, the term <b>range</b> may refer to one of three things:
</p>
<ol><li>The possible values that may be stored in a <a href="Variable_(programming)" class="mw-redirect" title="Variable (programming)">variable</a>.</li>
<li>The upper and lower bounds of an <a href="Array_data_structure" class="mw-redirect" title="Array data structure">array</a>.</li>
<li>An alternative to <a href="Iterator" title="Iterator">iterator</a>.</li></ol>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Range_of_a_variable">Range of a variable</h2></div>
<p>The range of a variable is given as the set of possible values that that variable can hold. In the case of an integer, the variable definition is restricted to whole numbers only, and the range will cover every number within its range (including the maximum and minimum). For example, the range of a <a href="Signedness" title="Signedness">signed</a> <a href="16-bit" class="mw-redirect" title="16-bit">16-bit</a> <a href="Integer_(computer_science)" title="Integer (computer science)">integer</a> variable is all the integers from −32,768 to +32,767.
</p>
<div class="mw-heading mw-heading2"><h2 id="Range_of_an_array">Range of an array</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1236090951">
/* start https://en.wikipedia.org/ */
.mw-parser-output .hatnote{font-style:italic}.mw-parser-output div.hatnote{padding-left:1.6em;margin-bottom:0.5em}.mw-parser-output .hatnote i{font-style:normal}.mw-parser-output .hatnote+link+.hatnote{margin-top:-0.5em}@media print{body.ns-0 .mw-parser-output .hatnote{display:none!important}}
/* end https://en.wikipedia.org/ */
</style><div role="note" class="hatnote navigation-not-searchable">Main article: <a href="Array_data_type" class="mw-redirect" title="Array data type">Array data type § Indexing notation</a></div>
<p>When an array is numerically indexed, its range is the upper and lower bound of the array. Depending on the environment, a warning, a <a href="Fatal_exception" class="mw-redirect" title="Fatal exception">fatal exception</a>, or unpredictable behavior will occur if the program attempts to access an array element that is outside the range. In some <a href="Programming_languages" class="mw-redirect" title="Programming languages">programming languages</a>, such as <a href="C_(programming_language)" title="C (programming language)">C</a>, arrays have a fixed lower bound (zero) and will contain data at each position up to the upper bound (so an array with 5 elements will have a range of 0 to 4). In others, such as <a href="PHP" title="PHP">PHP</a>, an array may have holes where no element is defined, and therefore an array with a range of 0 to 4 will have <i>up to</i> 5 elements (and a minimum of 2).
</p>
<div class="mw-heading mw-heading2"><h2 id="Range_as_an_alternative_to_iterator">Range as an alternative to iterator</h2></div>
<p>Another meaning of <i>range</i> in computer science is an alternative to <a href="Iterator" title="Iterator">iterator</a>. When used in this sense, range is defined as "a pair of begin/end iterators packed together".<sup id="cite_ref-itersmustgo_1-0" class="reference"><a href="#cite_note-itersmustgo-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> It is argued <sup id="cite_ref-itersmustgo_1-1" class="reference"><a href="#cite_note-itersmustgo-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> that "Ranges are a superior abstraction" (compared to iterators) for several reasons, including better safety.
</p><p>In particular, such ranges are supported in <a href="C%2B%2B20" title="C++20">C++20</a>,<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> <a href="Boost_C%2B%2B_Libraries" class="mw-redirect" title="Boost C++ Libraries">Boost C++ Libraries</a><sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> and the <a href="D_(programming_language)" title="D (programming language)">D</a> standard library.<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="Range_as_a_data_type">Range as a data type</h2></div>
<p>A data type for ranges can be implemented using <a href="Generic_programming" title="Generic programming">generics</a>.
</p><p>Example in <a href="C_Sharp_(programming_language)" title="C Sharp (programming language)">C#</a>.
</p>
<div class="mw-highlight mw-highlight-lang-csharp mw-content-ltr" dir="ltr"><pre><span class="k">public</span><span class="w"> </span><span class="k">record</span><span class="w"> </span><span class="n">Range</span><span class="o"><</span><span class="n">T</span><span class="o">></span><span class="p">(</span><span class="n">T</span><span class="w"> </span><span class="n">Start</span><span class="p">,</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="n">End</span><span class="p">)</span><span class="w"> </span><span class="k">where</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">IComparable</span><span class="p">;</span>
</pre></div>
<p>Example in <a href="Kotlin_(programming_language)" title="Kotlin (programming language)">Kotlin</a>.
</p>
<div class="mw-highlight mw-highlight-lang-kotlin mw-content-ltr" dir="ltr"><pre><span class="kd">data</span><span class="w"> </span><span class="kd">class</span><span class="w"> </span><span class="nc">Range</span><span class="o"><</span><span class="n">T</span><span class="p">:</span><span class="w"> </span><span class="n">Comparable</span><span class="o"><</span><span class="n">T</span><span class="o">>></span><span class="p">(</span><span class="kd">val</span><span class="w"> </span><span class="nv">start</span><span class="p">:</span><span class="w"> </span><span class="n">T</span><span class="p">,</span><span class="w"> </span><span class="kd">val</span><span class="w"> </span><span class="nv">end</span><span class="p">:</span><span class="w"> </span><span class="n">T</span><span class="p">)</span>
</pre></div>
<p>Example in <a href="PHP" title="PHP">PHP</a>.
</p>
<div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span class="nx">readonly</span> <span class="k">class</span> <span class="nc">Range</span><span class="o"><</span><span class="nx">T</span><span class="o">></span> <span class="p">{</span>
<span class="k">public</span> <span class="k">function</span> <span class="fm">__construct</span><span class="p">(</span>
<span class="k">public</span> <span class="nx">T</span> <span class="nv">$start</span><span class="p">,</span>
<span class="k">public</span> <span class="nx">T</span> <span class="nv">$end</span><span class="p">,</span>
<span class="p">)</span> <span class="p">{}</span>
<span class="p">}</span>
</pre></div>
<p>Example in <a href="Python_(programming_language)" title="Python (programming language)">Python</a>.
</p>
<div class="mw-highlight mw-highlight-lang-python mw-content-ltr" dir="ltr"><pre><span class="kn">from</span><span class="w"> </span><span class="nn">dataclasses</span><span class="w"> </span><span class="kn">import</span> <span class="n">dataclass</span>
<span class="nd">@dataclass</span>
<span class="k">class</span><span class="w"> </span><span class="nc">Range</span><span class="p">[</span><span class="n">T</span><span class="p">]:</span>
<span class="n">start</span><span class="p">:</span> <span class="n">T</span>
<span class="n">end</span><span class="p">:</span> <span class="n">T</span>
</pre></div>
<p><a href="Rust_(programming_language)" title="Rust (programming language)">Rust</a> has a built-in range struct in the standard library in <style data-mw-deduplicate="TemplateStyles:r886049734">
/* start https://en.wikipedia.org/ */
.mw-parser-output .monospaced{font-family:monospace,monospace}
/* end https://en.wikipedia.org/ */
</style><span class="monospaced">std::ops::Range</span>.<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="Range_as_a_operator">Range as a operator</h2></div>
<p><a href="Rust_(programming_language)" title="Rust (programming language)">Rust</a> has the <span class="monospaced">..</span> and <span class="monospaced">..=</span> operators.
</p>
<div class="mw-highlight mw-highlight-lang-rust mw-content-ltr" dir="ltr"><pre><span class="kd">let</span><span class="w"> </span><span class="n">heartwarming</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">"heartwarming!"</span><span class="p">.</span><span class="n">to_string</span><span class="p">();</span>
<span class="kd">let</span><span class="w"> </span><span class="n">warm</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&</span><span class="n">heartwarming</span><span class="p">[</span><span class="mi">5</span><span class="o">..</span><span class="mi">9</span><span class="p">];</span>
</pre></div>
<p><a href="Zig_(programming_language)" title="Zig (programming language)">Zig</a> also has the <span class="monospaced">..</span> operator.
</p>
<div class="mw-highlight mw-highlight-lang-zig mw-content-ltr" dir="ltr"><pre><span class="c1">// To iterate over consecutive integers, use the range syntax.</span>
<span class="kr">var</span><span class="w"> </span><span class="n">sum</span><span class="o">:</span><span class="w"> </span><span class="kt">usize</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
<span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="mi">0</span><span class="p">..</span><span class="mi">5</span><span class="p">)</span><span class="w"> </span><span class="o">|</span><span class="n">i</span><span class="o">|</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="n">sum</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="n">i</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
<p>As does <a href="C_Sharp_(programming_language)" title="C Sharp (programming language)">C#</a>,<sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-highlight mw-highlight-lang-csharp mw-content-ltr" dir="ltr"><pre><span class="kt">string</span><span class="w"> </span><span class="n">items</span><span class="p">[]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[</span><span class="s">"one"</span><span class="p">,</span><span class="s">"two"</span><span class="p">,</span><span class="s">"three"</span><span class="p">,</span><span class="s">"four"</span><span class="p">];</span>
<span class="kt">string</span><span class="w"> </span><span class="n">first_three_items</span><span class="p">[]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">items</span><span class="p">[</span><span class="mi">0</span><span class="p">.</span><span class="mf">.2</span><span class="p">];</span>
</pre></div>
<p><a href="F_Sharp_(programming_language)" title="F Sharp (programming language)">F#</a>,<sup id="cite_ref-7" class="reference"><a href="#cite_note-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-highlight mw-highlight-lang-fsharp mw-content-ltr" dir="ltr"><pre><span class="o">[</span><span class="mi">1</span><span class="o">..</span><span class="mi">4</span><span class="o">]</span>
<span class="c1">// Outputs: [1; 2; 3; 4]</span>
</pre></div>
<p><a href="Kotlin_(programming_language)" title="Kotlin (programming language)">Kotlin</a>,<sup id="cite_ref-8" class="reference"><a href="#cite_note-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-highlight mw-highlight-lang-kotlin mw-content-ltr" dir="ltr"><pre><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">i</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="m">1.</span><span class="p">.</span><span class="m">5</span><span class="p">)</span><span class="w"> </span><span class="n">print</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
</pre></div>
<p>and <a href="Perl" title="Perl">Perl</a>.<sup id="cite_ref-9" class="reference"><a href="#cite_note-9"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-highlight mw-highlight-lang-perl mw-content-ltr" dir="ltr"><pre><span class="k">for</span><span class="p">(</span><span class="w"> </span><span class="mi">1</span><span class="o">..</span><span class="mi">5</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">print</span><span class="w"> </span><span class="p">}</span>
</pre></div>
<p><a href="Python_(programming_language)" title="Python (programming language)">Python</a> and <a href="PHP_(programming_language)" class="mw-redirect" title="PHP (programming language)">PHP</a> does not have any range operator but they do have a <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">range</code> function.<sup id="cite_ref-10" class="reference"><a href="#cite_note-10"><span class="cite-bracket">[</span>10<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-11" class="reference"><a href="#cite_note-11"><span class="cite-bracket">[</span>11<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Interval_(mathematics)" title="Interval (mathematics)">Interval</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */
.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}
/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap mw-references-columns"><ol class="references">
<li id="cite_note-itersmustgo-1"><span class="mw-cite-backlink">^ <a href="#cite_ref-itersmustgo_1-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-itersmustgo_1-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */
.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}
/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFAndrei_Alexandrescu2009" class="citation web cs1"><a href="Andrei_Alexandrescu" title="Andrei Alexandrescu">Andrei Alexandrescu</a> (6 May 2009). <a rel="nofollow" class="external text" href="https://accu.org/content/conf2009/AndreiAlexandrescu_iterators-must-go.pdf">"Iterators Must Go"</a> <span class="cs1-format">(PDF)</span>. BoostCon 2009<span class="reference-accessdate">. Retrieved <span class="nowrap">29 July</span> 2014</span>.</cite></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://en.cppreference.com/w/cpp/ranges">cppreference</a></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://www.boost.org/libs/range/index.html">Boost.Range documentation</a></span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://dlang.org/phobos/std_range.html">D Phobos Runtime Library std.range module</a></span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://doc.rust-lang.org/std/ops/struct.Range.html">"Range in std::ops - Rust"</a>. <i>doc.rust-lang.org</i><span class="reference-accessdate">. Retrieved <span class="nowrap">17 October</span> 2024</span>.</cite></span>
</li>
<li id="cite_note-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-6">^</a></b></span> <span class="reference-text"><cite id="CITEREFBillWagner2023" class="citation web cs1">BillWagner (14 November 2023). <a rel="nofollow" class="external text" href="https://learn.microsoft.com/en-us/dotnet/csharp/tutorials/ranges-indexes">"Explore ranges of data using indices and ranges - C#"</a>. <i>learn.microsoft.com</i><span class="reference-accessdate">. Retrieved <span class="nowrap">2025-02-22</span></span>.</cite></span>
</li>
<li id="cite_note-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-7">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://camilotk.github.io/fsharp-by-example/chapters/range-operator/">"Range Operator"</a>. <i>F# by example</i>. 17 February 2023<span class="reference-accessdate">. Retrieved <span class="nowrap">2025-02-22</span></span>.</cite></span>
</li>
<li id="cite_note-8"><span class="mw-cite-backlink"><b><a href="#cite_ref-8">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://kotlinlang.org/docs/ranges.html#progression">"Ranges and progressions - Kotlin"</a>. <i>Kotlin Help</i><span class="reference-accessdate">. Retrieved <span class="nowrap">2025-02-22</span></span>.</cite></span>
</li>
<li id="cite_note-9"><span class="mw-cite-backlink"><b><a href="#cite_ref-9">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://perldoc.perl.org/perlop#Range-Operators">"perlop - Perl expressions: operators, precedence, string literals - Perldoc Browser"</a>. <i>perldoc.perl.org</i><span class="reference-accessdate">. Retrieved <span class="nowrap">2025-02-22</span></span>.</cite></span>
</li>
<li id="cite_note-10"><span class="mw-cite-backlink"><b><a href="#cite_ref-10">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://docs.python.org/3/library/functions.html#func-range">"Built-in Functions"</a>. <i>Python documentation</i>. Python Software Foundation<span class="reference-accessdate">. Retrieved <span class="nowrap">17 December</span> 2024</span>.</cite></span>
</li>
<li id="cite_note-11"><span class="mw-cite-backlink"><b><a href="#cite_ref-11">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://www.php.net/manual/en/function.range.php">"PHP: range - Manual"</a>. The PHP Documentation Group<span class="reference-accessdate">. Retrieved <span class="nowrap">17 December</span> 2024</span>.</cite></span>
</li>
</ol></div></div>
<p><br>
</p>
<style data-mw-deduplicate="TemplateStyles:r1271159938">
/* start https://en.wikipedia.org/ */
.mw-parser-output .asbox{position:relative;overflow:hidden}.mw-parser-output .asbox table{background:transparent}.mw-parser-output .asbox p{margin:0}.mw-parser-output .asbox p+p{margin-top:0.25em}.mw-parser-output .asbox-body{font-style:italic}.mw-parser-output .asbox-note{font-size:smaller}.mw-parser-output .asbox .navbar{position:absolute;top:-0.75em;right:1em;display:none}.mw-parser-output :not(p):not(.asbox)+style+.asbox,.mw-parser-output :not(p):not(.asbox)+link+.asbox{margin-top:3em}
/* end https://en.wikipedia.org/ */
</style></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-08-03" href="https://en.wikipedia.org/wiki/?title=Range_(computer_programming)&oldid=1304009777">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>